-
-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extending the c++ interface for plotting the parametrization #141
base: develop
Are you sure you want to change the base?
Conversation
… plot parametrization similar to the toppra python interface
For the future: how can I apply your clang format? |
Hi @ndehio, thanks for the contribution. However, I do not suggest this approach for "debugging" because it can be quite limited. For instance, the script that you printed can only used to debug and nothing else. I think it is better to serialize only the object internal data into a file stream and save to disk, then write a single python script to visualize it. This serialized data stream can then be used for debugging, logging, etc.. Currently, this is implemented for the geometric path via the serialize/deserialize methods here
For this feature, I propose to implement serialize/deserialize methods for ConstAccel instead. We can store the result of the most recent evaluation and serialize those altogether. |
I see your point, it makes sense to stay with the serialization approach. |
bool ConstAccel::plot_parametrization(const int n_sample) { | ||
// reimplements the function plot_parametrization() from the file toppra/parametrizer.py | ||
Vector _ss = this->m_gridpoints; | ||
Vector _velocities = this->m_vsquared; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vector _velocities = this->m_vsquared; | |
Vector _velocities = this->m_vsquared.cwiseSqrt(); |
We have test cases that verify the consistency of the output parametrization between the python and C++ implementation, so that shouldn't be the cause. There is 1 bug in your code, I have commented on it. One reason why the results are different is that the input path is not the same as in the python example. You can try the following Python code instead
|
Stale pull request message |
The new c++ method
plot_parametrization(const int n_sample)
reimplements the python-functionplot_parametrization()
from the filetoppra/parametrizer.py
.The function is tested in the test
test_toppra_approach.cpp
. Note, however, that the output is similar but not identical to the python example. Your feedback is welcome.